/* 整体浮动容器样式 */
.ai-qa-floating-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 999;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部样式 */
.ai-qa-header {
    background-color: #2e6bdc;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

/* 标题样式 */
.ai-qa-title {
    margin: 0;
    font-weight: 600;
}

/* 关闭按钮样式 */
.ai-qa-close {
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

/* 关闭按钮悬停效果 */
.ai-qa-close:hover {
    color: #ddd;
}

/* 历史记录区域样式 */
.ai-qa-history {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
}

/* 用户问题样式 */
.ai-qa-history .user-question {
    color: #2e6bdc;
    margin-bottom: 8px;
    align-self: flex-end;
    background-color: #e0e8f9;
    padding: 12px 16px;
    border-radius: 16px 16px 0 16px;
    white-space: pre-wrap;
    font-size: 14px;
    max-width: 80%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 机器人回答样式 */
.ai-qa-history .bot-answer {
    color: #333;
    margin-bottom: 12px;
    align-self: flex-start;
    background-color: #f0f4f8;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 0;
    white-space: pre-wrap;
    font-size: 14px;
    max-width: 80%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 推理过程样式 */
.ai-qa-history .bot-reasoning {
    color: #666;
    margin-bottom: 5px;
    font-style: normal;
}

/* 最终回答样式 */
.ai-qa-history .bot-final-answer {
    font-weight: 500;
    font-style: normal;
}

/* 欢迎语样式 */
.ai-qa-history .welcome-message {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #666;
    font-style: normal;
}

/* 输入框组样式 */
.ai-qa-input-group {
    display: flex;
    padding: 15px;
}

/* 输入框样式 */
.ai-qa-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

/* 输入框聚焦效果 */
.ai-qa-input:focus {
    border-color: #2e6bdc;
}

/* 操作按钮样式 */
.ai-qa-action-button {
    background-color: #2e6bdc;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

/* 操作按钮悬停效果 */
.ai-qa-action-button:hover {
    background-color: #2356b3;
}

/* 联系客服按钮样式 */
.ai-qa-button {
    display: block;
    width: calc(100% - 30px);
    padding: 10px;
    margin: 0 15px 15px 15px;
    background-color: #2e6bdc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    text-align: center;
}

/* 联系客服按钮悬停效果 */
.ai-qa-button:hover {
    background-color: #2356b3;
}

/* 切换按钮样式 */
.ai-qa-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #2e6bdc;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease;
    z-index: 998;
    animation: pulse 1.5s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 切换按钮悬停效果 */
.ai-qa-toggle-button:hover {
    background-color: #2356b3;
}

/* 加载器样式 */
.ai-qa-loader {
    text-align: center;
    padding: 10px 0;

}

/* 旋转加载图标样式 */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border-top-color: #2e6bdc;
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

/* 旋转动画 */
@keyframes spin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

@-webkit-keyframes spin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

/* 提示词样式 */
.ai-qa-tips {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 997;
    color: #666;
}

/* 复制答案按钮样式 */
.copy-answer-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #2e6bdc;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bot-answer:hover .copy-answer-button {
    opacity: 1;
    visibility: visible;
}

.copy-answer-button:hover {
    background-color: #2356b3;
}

/* 代码样式 */
.bot-answer pre {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

.bot-answer code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f7f7f7;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 未登录提示容器样式 */
.ai-qa-login-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 999;
    text-align: center;
}

/* 登录按钮样式 */
.ai-qa-login-button {
    display: inline-block;
    background-color: #2e6bdc;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    margin-top: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ai-qa-login-button:hover {
    background-color: #2356b3;
}
    